package com.ltmonitor.service.impl;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ltmonitor.dao.IAdasDeviceSystemInfoDao;
import com.ltmonitor.adas.entity.AdasDeviceSystemInfo;
import com.ltmonitor.service.IAdasDeviceSystemInfoService;

@Service("adasDeviceSystemInfoService")
public class AdasDeviceSystemInfoService extends BaseService<Long, AdasDeviceSystemInfo> implements IAdasDeviceSystemInfoService {

	@Autowired
	private IAdasDeviceSystemInfoDao AdasDeviceSystemInfoDao;

	/**
	 * 获得车辆终端的Adas外设系统信息
	 * @param vehicleId
	 * @return
	 */
	public AdasDeviceSystemInfo getAdasDeviceSystemInfoByVehicleId(long vehicleId,int adasDeviceId)
	{
		String hql = "from AdasDeviceSystemInfo where vehicleId = ? and adasId = ? ";
		AdasDeviceSystemInfo t = this.baseDao.find(hql, new Object[]{vehicleId, adasDeviceId});
		return t;
	}

	/**
	 * 下发获取命令，根据命令Id,获得车辆终端的Adas外设系统信息
	 * @param commandId 下发的终端命令id
	 * @return
	 */
	public List<AdasDeviceSystemInfo> getAdasDeviceSystemInfoByCommandId(long commandId)
	{
		String hql = "from AdasDeviceSystemInfo where commandId = ?";
		return this.baseDao.query(hql, commandId);
	}


}
